package com.qf;

import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 孙亚梅
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.config
 * @Description:
 * @Date 2022/6/30 21:49
 */

@RestController
public class HelloController {

    /**
     * 注入初始化的user对象
     */
    @Resource(name ="user1")
    private User user;

    @Value("${alibaba.ip}")
    private  String ip;

    @Value("${alibaba.username}")
    private  String  username;

    @Value("${alibaba.password}")
    private  String password;


    @RequestMapping("/hello")
    public  String hello(){

        System.out.println("========="+ip);
        System.out.println("========="+username);
        System.out.println("========="+password);

        System.out.println("========" +user);
        return  "欢迎使用springboot！";

    }
}
